/*
 * 传感器模块头文件
 * 包含所有传感器的接口定义
 */

#ifndef SENSOR_MODULE_H
#define SENSOR_MODULE_H

#include <Arduino.h>

// 传感器数据结构
typedef struct {
  float temperature;
  float humidity;
  int soilMoisture;
  uint16_t lightIntensity;
  float co2Level;
  float tvocLevel;
} SensorData;

// 传感器模块类
class SensorModule {
public:
  SensorModule();
  void begin();
  void readAllSensors();
  SensorData getData();
  void displayData();
  bool checkAlerts();
  
private:
  SensorData sensorData;
  
  // 阈值设置
  const float TEMP_THRESHOLD_HIGH = 35.0;
  const float TEMP_THRESHOLD_LOW = 10.0;
  const float HUMIDITY_THRESHOLD_HIGH = 80.0;
  const float HUMIDITY_THRESHOLD_LOW = 40.0;
  const int SOIL_MOISTURE_THRESHOLD_LOW = 300;
  const uint16_t LIGHT_THRESHOLD_LOW = 1000;
  const float CO2_THRESHOLD_HIGH = 1200.0;
};

#endif